home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / WINDOWS / EZNET.ZIP / DEMO.ZIP / NETWORK.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-11-05  |  10.2 KB  |  335 lines

  1. VERSION 4.00
  2. Begin VB.Form Form2 
  3.    Appearance      =   0  'Flat
  4.    BackColor       =   &H80000005&
  5.    Caption         =   "Example 2: NetWork"
  6.    ClientHeight    =   4200
  7.    ClientLeft      =   1095
  8.    ClientTop       =   1830
  9.    ClientWidth     =   6270
  10.    BeginProperty Font 
  11.       name            =   "MS Sans Serif"
  12.       charset         =   0
  13.       weight          =   700
  14.       size            =   8.25
  15.       underline       =   0   'False
  16.       italic          =   0   'False
  17.       strikethrough   =   0   'False
  18.    EndProperty
  19.    ForeColor       =   &H80000008&
  20.    Height          =   4605
  21.    Left            =   1035
  22.    LinkTopic       =   "Form2"
  23.    MDIChild        =   -1  'True
  24.    ScaleHeight     =   4200
  25.    ScaleWidth      =   6270
  26.    Tag             =   "2"
  27.    Top             =   1485
  28.    Width           =   6390
  29.    Begin VB.PictureBox Picture1 
  30.       Appearance      =   0  'Flat
  31.       BackColor       =   &H80000005&
  32.       ForeColor       =   &H80000008&
  33.       Height          =   525
  34.       Index           =   0
  35.       Left            =   3120
  36.       ScaleHeight     =   495
  37.       ScaleWidth      =   555
  38.       TabIndex        =   4
  39.       Top             =   3615
  40.       Visible         =   0   'False
  41.       Width           =   585
  42.    End
  43.    Begin VB.PictureBox Picture1 
  44.       Appearance      =   0  'Flat
  45.       BackColor       =   &H80000005&
  46.       ForeColor       =   &H80000008&
  47.       Height          =   525
  48.       Index           =   3
  49.       Left            =   4950
  50.       Picture         =   "NETWORK.frx":0000
  51.       ScaleHeight     =   495
  52.       ScaleWidth      =   555
  53.       TabIndex        =   2
  54.       Top             =   3615
  55.       Visible         =   0   'False
  56.       Width           =   585
  57.    End
  58.    Begin VB.PictureBox Picture1 
  59.       Appearance      =   0  'Flat
  60.       BackColor       =   &H80000005&
  61.       ForeColor       =   &H80000008&
  62.       Height          =   525
  63.       Index           =   2
  64.       Left            =   4335
  65.       Picture         =   "NETWORK.frx":0442
  66.       ScaleHeight     =   495
  67.       ScaleWidth      =   555
  68.       TabIndex        =   1
  69.       Top             =   3615
  70.       Visible         =   0   'False
  71.       Width           =   585
  72.    End
  73.    Begin VB.PictureBox Picture1 
  74.       Appearance      =   0  'Flat
  75.       BackColor       =   &H80000005&
  76.       ForeColor       =   &H80000008&
  77.       Height          =   525
  78.       Index           =   1
  79.       Left            =   3735
  80.       Picture         =   "NETWORK.frx":0884
  81.       ScaleHeight     =   495
  82.       ScaleWidth      =   540
  83.       TabIndex        =   0
  84.       Top             =   3615
  85.       Visible         =   0   'False
  86.       Width           =   570
  87.    End
  88.    Begin EasynetLib.Easynet Net1 
  89.       Height          =   3210
  90.       Left            =   240
  91.       TabIndex        =   3
  92.       Top             =   195
  93.       Width           =   4590
  94.       _Version        =   65538
  95.       _ExtentX        =   8096
  96.       _ExtentY        =   5662
  97.       _StockProps     =   101
  98.       BackColor       =   16777215
  99.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  100.          name            =   "MS Sans Serif"
  101.          charset         =   0
  102.          weight          =   400
  103.          size            =   8.25
  104.          underline       =   0   'False
  105.          italic          =   0   'False
  106.          strikethrough   =   0   'False
  107.       EndProperty
  108.       BorderStyle     =   1
  109.       xGrid           =   5
  110.       yGrid           =   5
  111.       Shape           =   0
  112.       FillColor       =   16777215
  113.       DrawColor       =   0
  114.       ForeColor       =   0
  115.       DrawWidth       =   1
  116.       Oriented        =   -1  'True
  117.       ReadOnly        =   0   'False
  118.       MultiSel        =   -1  'True
  119.       ScrollBars      =   3
  120.       CanDrawNode     =   -1  'True
  121.       CanDrawLink     =   -1  'True
  122.       CanMoveNode     =   -1  'True
  123.       CanSizeNode     =   -1  'True
  124.       CanStretchLink  =   -1  'True
  125.       CanMultiLink    =   -1  'True
  126.       Transparent     =   0   'False
  127.       DrawStyle       =   0
  128.       Alignment       =   7
  129.       BackPicture     =   "NETWORK.frx":0B8E
  130.       ShowGrid        =   0   'False
  131.       LinkHead        =   0
  132.       DoSelChange     =   -1  'True
  133.       DoAddNode       =   -1  'True
  134.       DoAddLink       =   -1  'True
  135.       Hiding          =   0   'False
  136.       ImageFile       =   ""
  137.       DisplayHandles  =   -1  'True
  138.       Zoom            =   100
  139.       AutoSize        =   0
  140.       AutoScroll      =   -1  'True
  141.    End
  142. Attribute VB_Name = "Form2"
  143. Attribute VB_Creatable = False
  144. Attribute VB_Exposed = False
  145. Option Explicit
  146. Private Sub banner2()
  147.   Dim Node(1 To 21) As Long
  148.   With Net1
  149.     Node(1) = .AddNodeItem
  150.     .SetNodeRect Node(1), 4455, 180, 7140, 3135
  151.     .ForeColor = 255
  152.     .DrawStyle = 2
  153.     .DrawColor = 255
  154.     .Alignment = 6
  155.     .Transparent = True
  156.     .Text = Chr$(13) + Chr$(10) + "INTERNET"
  157.     Node(2) = .AddNodeItem
  158.     .SetNodeRect Node(2), 240, 150, 3765, 3255
  159.     .ForeColor = 255
  160.     .DrawColor = 255
  161.     .DrawStyle = 2
  162.     .Alignment = 6
  163.     .Transparent = True
  164.     .Text = Chr$(13) + Chr$(10) + "INTRANET"
  165.     Node(3) = .AddNodeItem  'LAN
  166.     .SetNodeRect Node(3), 540, 1935, 3510, 1980
  167.     .Shape = 1
  168.     .FillColor = 0
  169.     Node(4) = .AddNodeItem  'Router
  170.     .SetNodeRect Node(4), 3060, 2115, 3300, 2370
  171.     .Shape = 7
  172.     .FillColor = 0
  173.     Node(5) = .AddNodeItem  'Router
  174.     .SetNodeRect Node(5), 5025, 2100, 5265, 2340
  175.     .Shape = 6
  176.     .FillColor = 0
  177.     Node(6) = .AddNodeItem  'Server
  178.     .SetNodeRect Node(6), 690, 675, 1350, 1620
  179.     .FillColor = 16777215
  180.     .DrawStyle = 5
  181.     .Alignment = 6
  182.     .Shape = 1
  183.     .Transparent = True
  184.     .Text = "Server NT"
  185.     .Picture = Picture1(3).Picture
  186.     .Type = 3
  187.     Node(7) = .AddNodeItem  'PC client
  188.     .SetNodeRect Node(7), 1710, 1155, 2190, 1635
  189.     .FillColor = 16777215
  190.     .DrawStyle = 5
  191.     .Shape = 1
  192.     .Transparent = True
  193.     .Picture = Picture1(1).Picture
  194.     .Type = 1
  195.     Node(8) = .AddNodeItem  'PC client
  196.     .SetNodeRect Node(8), 1245, 2340, 1725, 2805
  197.     .FillColor = 16777215
  198.     .DrawStyle = 5
  199.     .Shape = 1
  200.     .Transparent = True
  201.     .Picture = Picture1(1).Picture
  202.     .Type = 1
  203.     Node(9) = .AddNodeItem  ' Mac client
  204.     .SetNodeRect Node(9), 2175, 2340, 2655, 2820
  205.     .FillColor = 16777215
  206.     .DrawStyle = 5
  207.     .Shape = 1
  208.     .Transparent = True
  209.     .Picture = Picture1(2).Picture
  210.     .Type = 2
  211.     Node(10) = .AddNodeItem
  212.     .SetNodeRect Node(10), 1920, 1905, 1980, 1965
  213.     .FillColor = 0
  214.     .Shape = 1
  215.     Node(11) = .AddNodeItem
  216.     .SetNodeRect Node(11), 2385, 1935, 2445, 1995
  217.     .FillColor = 0
  218.     .Shape = 1
  219.     Node(12) = .AddNodeItem
  220.     .SetNodeRect Node(12), 1440, 1935, 1500, 1995
  221.     .FillColor = 0
  222.     .Shape = 1
  223.     Node(13) = .AddNodeItem
  224.     .SetNodeRect Node(13), 3165, 1950, 3225, 2010
  225.     .FillColor = 0
  226.     .Shape = 1
  227.     Node(14) = .AddNodeItem
  228.     .SetNodeRect Node(14), 960, 1905, 1020, 1965
  229.     .FillColor = 0
  230.     .Shape = 1
  231.     Node(15) = .AddNodeItem
  232.     .SetNodeRect Node(15), 5790, 750, 6270, 1125
  233.     .FillColor = 8454143
  234.     Node(16) = .AddNodeItem
  235.     .SetNodeRect Node(16), 5805, 1995, 6270, 2385
  236.     .FillColor = 8454143
  237.     Node(17) = .AddNodeItem
  238.     .SetNodeRect Node(17), 5130, 2475, 5565, 2820
  239.     .FillColor = 8454143
  240.     Node(18) = .AddNodeItem
  241.     .SetNodeRect Node(18), 6570, 885, 6930, 1275
  242.     .Transparent = True
  243.     .DrawStyle = 5
  244.     .Text = "..."
  245.     Node(19) = .AddNodeItem
  246.     .SetNodeRect Node(19), 6585, 1605, 6915, 1890
  247.     .Transparent = True
  248.     .DrawStyle = 5
  249.     .Text = "..."
  250.     Node(20) = .AddNodeItem
  251.     .SetNodeRect Node(20), 4620, 1290, 5610, 1875
  252.     .FillColor = 8454143
  253.     .Text = "Internet provider"
  254.     ' Set owners:
  255.     ' The five little black boxes are owned by the "LAN" node
  256.     .SetNodeOwner Node(10), Node(3)
  257.     .SetNodeOwner Node(11), Node(3)
  258.     .SetNodeOwner Node(12), Node(3)
  259.     .SetNodeOwner Node(13), Node(3)
  260.     .SetNodeOwner Node(14), Node(3)
  261.     ' All other nodes inside the INTRANET node are owned by this node
  262.     .SetNodeOwner Node(3), Node(2)
  263.     .SetNodeOwner Node(4), Node(2)
  264.     .SetNodeOwner Node(6), Node(2)
  265.     .SetNodeOwner Node(7), Node(2)
  266.     .SetNodeOwner Node(8), Node(2)
  267.     .SetNodeOwner Node(9), Node(2)
  268.     ' All nodes inside the INTERNET node are owned by this node
  269.     .SetNodeOwner Node(20), Node(1)
  270.     .SetNodeOwner Node(19), Node(1)
  271.     .SetNodeOwner Node(18), Node(1)
  272.     .SetNodeOwner Node(15), Node(1)
  273.     .SetNodeOwner Node(16), Node(1)
  274.     .SetNodeOwner Node(17), Node(1)
  275.     .SetNodeOwner Node(5), Node(1)
  276.     ' The link between intranet and internet
  277.     Dim link As Long
  278.     link = .AddLinkItem(Node(5), Node(4))
  279.     .SetItemDrawWidth link, 2
  280.     ' Other links
  281.     .AddLinkItem Node(7), Node(10)
  282.     .AddLinkItem Node(9), Node(11)
  283.     .AddLinkItem Node(8), Node(12)
  284.     .AddLinkItem Node(4), Node(13)
  285.     .AddLinkItem Node(5), Node(20)
  286.     .AddLinkItem Node(20), Node(15)
  287.     .AddLinkItem Node(16), Node(20)
  288.     .AddLinkItem Node(16), Node(15)
  289.     .AddLinkItem Node(16), Node(17)
  290.     .AddLinkItem Node(15), Node(18)
  291.     .AddLinkItem Node(16), Node(19)
  292.     .AddLinkItem Node(6), Node(14)
  293.     .item = 0
  294.   End With
  295. End Sub
  296. Private Sub Form_Activate()
  297.   ActivateForm
  298. End Sub
  299. Private Sub Form_Deactivate()
  300.   DeactivateForm
  301. End Sub
  302. Private Sub Form_Load()
  303.   MDI1.ShowExample(1).Enabled = False
  304.   MDI1.Command5.Enabled = False
  305.   Net1.Left = 0
  306.   Net1.Top = 0
  307.   Net1.DrawStyle = 6
  308.   Net1.Oriented = False
  309.   SpeedON Net1
  310.   banner2
  311.   SpeedOFF Net1
  312. End Sub
  313. Private Sub Form_Resize()
  314.   If WindowState <> 1 And ScaleHeight <> 0 Then
  315.     Net1.Height = ScaleHeight
  316.     Net1.Width = ScaleWidth
  317.   End If
  318. End Sub
  319. Private Sub Form_Unload(Cancel As Integer)
  320.   MDI1.ShowExample(1).Enabled = True
  321.   MDI1.Command5.Caption = "Comments "
  322. End Sub
  323. Private Sub Net1_AddNode()
  324.   If Net1.X2 - Net1.X1 < 200 Then Net1.X2 = Net1.X1 + 200
  325.   If Net1.Y2 - Net1.Y1 < 200 Then Net1.Y2 = Net1.Y1 + 200
  326. End Sub
  327. Private Sub Net1_DblClick()
  328.   frmItemProp.Show 1
  329. End Sub
  330. Private Sub Net1_KeyDown(KeyCode As Integer, Shift As Integer)
  331.   If KeyCode = KEY_DELETE Then
  332.     Net1.DeleteSel
  333.   End If
  334. End Sub
  335.